<!-- #INCLUDE Virtual="/lib.asp" -->
<!-- #INCLUDE Virtual="/lib_gen.asp" -->

<%
set fs = CreateObject("Scripting.FileSystemObject")
fname = "c:\data\svnchangelog.txt"
set file = fs.openTextFile(fname, ForReading)

dim rssInhoud
rssInhoud = ""

dim count
count = 0

block = false
vline = ""
text = ""
litext = ""
while not file.AtEndOfStream
	line = file.readline
	if instr(line, "-----------------") = 1 and user <> "" then
		block = false
		if (count <= 10) then 
			litext = replace(trim(text), "<br/>", " ")
			litext = server.htmlEncode(litext)
			' process allowed tags
			for each tag in Array("b", "strong", "i")
				litext = replace(litext, "&lt;" & tag & "&gt;", "<" & tag & ">")
				litext = replace(litext, "&lt;/" & tag & "&gt;", "</" & tag & ">")
			next
			rssInhoud = rssInhoud & "<li class='commit-item'>" & datetime(1) & " <strong>" & trim(user) & "</strong>: " & litext & "</li>"
		end if
		count = count + 1
		text = ""
	end if
	if block then
		text = text & line & "<br/>"
	end if
	if line = "Changed paths:" then
		info = split(vline, "|")
		user = info(1)
		datetime = split(trim(info(2)), " ")
	end if
	if line = "" then
		block = true
	end if
	vline = line
wend

'set wshell = CreateObject("WScript.Shell") 
'wshell.run "c:\data\gethippo.bat" 
'set wshell = nothing

rssInhoud = "<ul>" & rssInhoud & "</ul>"
rssInhoud = rssInhoud & "<script>" & vbcrlf & "var tot, wh=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;" & vbcrlf & "$(document).ready(function(){ " & vbcrlf & "tot=$('h1').height() + 130;" & vbcrlf & "$('li.commit-item').each( function() { tot = tot + $(this).height() + 10; if (tot>wh) $(this).hide() } ) } )" & vbcrlf & "</script>"

call generatePage(request("preview"), request.querystring("nextpage"), "Politie.nl commits", rssImage, rssInhoud)

%>